package com.controller.api;

import com.biz.CopywritingRulesBiz;
import com.biz.NewsBiz;
import com.controller.backend.BaseController;
import com.core.Result;
import com.core.ResultGenerator;
import com.entity.model.CopywritingRules;
import com.entity.model.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Condition;

import java.util.List;

/**
* Created by jc on 2019/11/16.
*/
@RestController("apiCopywritingRulesController")
@RequestMapping("/api/copywritingRules")
public class copywritingRulesController extends BaseController<CopywritingRules>{
    @Autowired
    private CopywritingRulesBiz copywritingRulesBiz;


    @RequestMapping(value = "/rulesList")
    public Result rulesList() {
        Condition condition=new Condition(News.class);
        condition.createCriteria().andEqualTo("id",1);
        CopywritingRules copywritingRule = copywritingRulesBiz.findByCondition(condition).get(0);
        return ResultGenerator.genSuccessResult(copywritingRule);
    }

}
